import http from "@/utils/request";

//  获取所有商品信息并分页的接口
export function getAllTypeAndPageRequest (currentPage,pageSize) {
    return http({
        url:'/type',
        method:'get',
        data:{},
        params:{currentPage,pageSize}
    })
}

//  获取所有商品信息的接口
export function getAllTypeRequest () {
    return http({
        url:'/type/getAllType',
        method:'get',
        data:{}
    })
}

//  添加商品类型信息的接口
export function addTypeRequest (addTypeData) {
    return http({
        url:'/type',
        method:'post',
        data:addTypeData
    })
}

//  添加商品类型信息的接口
export function updateTypeRequest (addTypeData) {
    return http({
        url:'/type',
        method:'put',
        data:addTypeData
    })
}

//  根据id查询商品类型信息的接口
export function getTypeByIdRequest (typeId) {
    return http({
        url:`/type/${typeId}`,
        method:'get',
        data:{}
    })
}

//  根据商品类型名称查询商品类型信息的接口
export function getTypeByNameRequest (searchName) {
    return http({
        url:'/type/getTypeByName',
        method:'get',
        data:{},
        params:{
            searchTypeName:searchName
        }
    })
}

//  根据商品类型id删除商品类型信息的接口
export function deleteTypeByIdRequest (typeId) {
    return http({
        url:`/type/${typeId}`,
        method:'delete',
        data:{}
    })
}